import socket

sock = socket.socket(socket.AF_INET6, socket.SOCK_STREAM, 0)
sock.bind(('',50000))
sock.listen(5)

connfd, address = sock.accept();
print 'connect from', address
buff = connfd.recv(8192)
print buff
connfd.close()
sock.close()
